<!DOCTYPE   html>
<html>
<head>
<meta charset="UTF-8">
<title>
</title>
<script type="text/javascript" src="js/vue-2.6.10.js"></script>
<script type="text/javascript" src="js/axios.js"></script>
<style>
	*{
		margin: 0;
		padding: 0;
	}
	.content{
		background: rgba(255,255,255,0.6);
		width: 500px;
		height: 500px;
		margin: auto;
		border-radius: 10px;
	}
	.content1{
		width: 250px;
		margin: 20px auto;
	}
	#username{
		
		width: 245px;
		height: 30px;
	}
	#password{
		width: 245px;
		height: 30px;
	}
	.an_jian{
		width: 100px;
		margin: auto;
	}
	#an_jian{
		width: 100px;
		margin: auto;
	}
	#an_jian2{
		width: 100px;
		margin: 20px auto;
		background-color: #F2F2F2;
		border: 1px solid;
	}
	#an_jian2 > a{
		
		color: #000000;
		text-decoration: none;
		
		
	}
</style>
</head>
<body style="background: linear-gradient(#DCC3FF,#FFCEF6); height: 1100px;">
	<div><h1 align="center">修改信息</h1></div>
	<div class="content">
		<div class="content1">
		<form action="/managerSystem/updateOrder.do" method="Post" id="app">
       	<input type="hidden" v-model='order.id' name="id">
        <label   for="username">订单名称：</label><br>
        <input    type="text" v-model="order.username"  id="name"   name="name"   required><br>
        <label   for="password">地址：</label><br>
        <input    type="password"  v-model="order.password" id="oaddress"   name="oaddress"   required><br>

           <div id="an_jian"><input type="submit"   value="完成"  class="an_jian"></div>
       		<div id="an_jian2" ><a href="order.html"><h3 align="center">返回</h2></a></div>
       </form>
       <script type="text/javascript">
           function parseUrlParams() {
                var url = window.location.href;
                var paramString = url.split('?')[1];
                var paramPairs = paramString.split('&');
                var params = {};
                paramPairs.reduce(function(params, pair) {
                    var parts = pair.split('=');
                    var key = parts[0];
                    var value = decodeURIComponent(parts[1] || '');
                    if (params[key]) {
                        params[key].push(value);
                    } else {
                        params[key] = [value];
                    }
                    return params;
                }, params);
                return params;
            }             
           let vue = new Vue({
                el: '#app',
                data:{
                    order:{
                        id: '',
                        name:'',
                        oaddress: ''
                    }
                },
                created(){
                    params = parseUrlParams();
                    //url: 表示异步请求地址
                    axios.get('/managerSystem/selectOrderById.do?id='+params.id[0]).then(
                        function(res_obj){
                            //使用获取的数据来给vue对象中的users数据赋值
                            vue.order = res_obj.data; 
                        }
                    ).catch(
                        function(error_obj){
                            alert("网络加载异常！！！");
                        }
                    )
                }
            });
    </script>
		</div>
	</div>
</body>
</html>